import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Kind from '../views/Kind.vue'
import Cart from '../views/Cart.vue'
import Me from '../views/Me.vue'
import Error from '../views/Error.vue'
import Details from '../views/Details.vue'
import Foot from '../components/Footer/Foot.vue'
import Login from '../views/Login.vue'
import Search from '../views/Search.vue'
import Address from '../views/Address.vue'
import City from '../views/City.vue'
import Order from '../views/Order.vue'
import PayFor from '../views/PayFor.vue'
import AddAddress from '../views/AddAddress.vue'
import CartList from '../views/CartList.vue'
import MyOrder from '../views/MyOrder.vue'
import Changepassword from '../views/Changepassword.vue'
import Register from '../views/Register/Register.vue'
import Reg1 from '../views/Register/Reg1.vue'
import Reg2 from '../views/Register/Reg2.vue'
import Reg3 from '../views/Register/Reg3.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  }
  , {
    path: '/home',
    name: 'Home',
    components: {
      default: Home,
      Foot
    }
  },
  {
    path: '/kind',
    name: 'Kind',
    components: {
      default: Kind,
      Foot
    },
  },
  {
    path: '/cart',
    name: 'Cart',
    component:Cart
  },
  {
    path: '/me',
    name: 'Me',
    components: {
      default: Me,
      Foot
    }
  },
  {
    path: '/details/:proid',
    name: 'Details',
    component: Details
  }, 
  {
    path:'/login',
    name:'Login',
    component:Login
  },
  {
    path:'/register',
    redirect: '/register/reg1'
  },
  {
    path:'/register',
    name:'Register',
    component:Register,
    children:[
      {
        path:'/register/reg1',
        name:'Reg1',
        component:Reg1
      },
      {
        path:'/register/reg2',
        name:'Reg2',
        component:Reg2
      },
      {
        path:'/register/reg3',
        name:'Reg3',
        component:Reg3
      },

    ]
  },
  {
    path:'/search',
    name:'Search',
    component:Search
  },
  {
    path:'/cartlist/:keyword',
    name:'CartList',
    component:CartList
  },
  {
    path:'/changepassword',
    name:'Changepassword',
    component:Changepassword
  },
  {
   path:'/address',
   name:'Address',
   component:Address
  },
  {
    path:'/addaddress',
    name:'AddAddress',
    component:AddAddress
   },
   {
    path:'/city',
    name:'City',
    component:City
   },
   {
    path:'/order',
    name:'Order',
    component:Order,
   },
   {
    path:'/myorder',
    name:'MyOrder',
    component:MyOrder,
   },
   {
    path:'/payfor/:SumMoney',
    name:'PayFor',
    component:PayFor,
   },
  {
    path: '*',
    name: 'Error',
    component: Error
  },
]

const router = new VueRouter({
  routes
})

export default router
